<?php
//声明命名空间
namespace Admin\Model;

use Frame\Libs\BaseModel;

final class ArticleModel extends BaseModel
{
    protected $table = "article";
    public function Article($where,$startpage,$pagesize)
    {
        $sql  = "select article.*,user.username,category.classname from {$this->table} ";
        $sql .= "inner join user on article.user_id = user.id ";
        $sql .= "inner join category on article.category_id = category.id ";
		$sql .= "where {$where} ";
        $sql .= "order by article.id ";
		$sql .= "limit $startpage,$pagesize";
        $result = $this->pdo->fetchAll($sql);
        return $result;
    }
}